package cn.android.mydata2.receiver;

import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.net.wifi.WifiManager;
import android.telephony.PhoneStateListener;
import android.telephony.TelephonyManager;
import android.util.Log;

import cn.android.mydata2.listener.PhoneListen;

public class CoreReceiver extends BroadcastReceiver {
    public CoreReceiver() {
    }


    @Override
    public void onReceive(Context context, Intent intent) {

        Log.e("Receiver","receive");
        // Receive [network] event
        PhoneListen phone = new PhoneListen(context);
        TelephonyManager telephony = (TelephonyManager)
                context.getSystemService(Context.TELEPHONY_SERVICE);
        telephony.listen(phone, PhoneStateListener.LISTEN_DATA_CONNECTION_STATE);
    }
}
